00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef WSIEG1_HPP
00011 #define WSIEG1_HPP
00012 #include "gridpack/component/data_collection.hpp"
00013 #include "gridpack/parser/dictionary.hpp"
00014 #include "gridpack/utilities/string_utils.hpp"
00015 namespace gridpack {
00016 namespace parser {
00017 template <class _data_struct> class Wsieg1Parser
00018 {
00019 public:
00020
00021
00022
00023 explicit Wsieg1Parser()
00024 {
00025 }
00026
00027
00028
00029
00030 virtual ~Wsieg1Parser()
00031 {
00032 }
00033
00034
00035
00036
00037
00038
00039
00040 void extract(_data_struct &data_struct,
00041 gridpack::component::DataCollection *data, int g_id)
00042 {
00043 double rval;
00044 bool bval;
00045 int ival;
00046
00047 if (!data->getValue(HAS_GOVERNOR,&bval,g_id)) {
00048 data->addValue(HAS_GOVERNOR, true, g_id);
00049 } else {
00050 data->setValue(HAS_GOVERNOR, true, g_id);
00051 }
00052
00053
00054 std::string stmp;
00055 if (!data->getValue(GOVERNOR_MODEL, &stmp, g_id)) {
00056 data->addValue(GOVERNOR_MODEL, data_struct.model, g_id);
00057 } else {
00058 data->setValue(GOVERNOR_MODEL, data_struct.model, g_id);
00059 }
00060
00061
00062 if (!data->getValue(GOVERNOR_JBUS,&ival,g_id)) {
00063 data->addValue(GOVERNOR_JBUS, data_struct.jbus, g_id);
00064 } else {
00065 data->setValue(GOVERNOR_JBUS, data_struct.jbus, g_id);
00066 }
00067
00068
00069 if (!data->getValue(GOVERNOR_M,&ival,g_id)) {
00070 data->addValue(GOVERNOR_M, data_struct.gv_m, g_id);
00071 } else {
00072 data->setValue(GOVERNOR_M, data_struct.gv_m, g_id);
00073 }
00074
00075
00076 if (!data->getValue(GOVERNOR_K,&rval,g_id)) {
00077 data->addValue(GOVERNOR_K, data_struct.gv_k, g_id);
00078 } else {
00079 data->setValue(GOVERNOR_K, data_struct.gv_k, g_id);
00080 }
00081
00082
00083 if (!data->getValue(GOVERNOR_T1,&rval,g_id)) {
00084 data->addValue(GOVERNOR_T1, data_struct.gv_t1, g_id);
00085 } else {
00086 data->setValue(GOVERNOR_T1, data_struct.gv_t1, g_id);
00087 }
00088
00089
00090 if (!data->getValue(GOVERNOR_T2,&rval,g_id)) {
00091 data->addValue(GOVERNOR_T2, data_struct.gv_t2, g_id);
00092 } else {
00093 data->setValue(GOVERNOR_T2, data_struct.gv_t2, g_id);
00094 }
00095
00096
00097 if (!data->getValue(GOVERNOR_T3,&rval,g_id)) {
00098 data->addValue(GOVERNOR_T3, data_struct.gv_t2, g_id);
00099 } else {
00100 data->setValue(GOVERNOR_T3, data_struct.gv_t3, g_id);
00101 }
00102
00103
00104 if (!data->getValue(GOVERNOR_UO,&rval,g_id)) {
00105 data->addValue(GOVERNOR_UO, data_struct.gv_uo, g_id);
00106 } else {
00107 data->setValue(GOVERNOR_UO, data_struct.gv_uo, g_id);
00108 }
00109
00110
00111 if (!data->getValue(GOVERNOR_UC,&rval,g_id)) {
00112 data->addValue(GOVERNOR_UC, data_struct.gv_uc, g_id);
00113 } else {
00114 data->setValue(GOVERNOR_UC, data_struct.gv_uc, g_id);
00115 }
00116
00117
00118 if (!data->getValue(GOVERNOR_PMAX,&rval,g_id)) {
00119 data->addValue(GOVERNOR_PMAX, data_struct.pmax, g_id);
00120 } else {
00121 data->setValue(GOVERNOR_PMAX, data_struct.pmax, g_id);
00122 }
00123
00124
00125 if (!data->getValue(GOVERNOR_PMIN,&rval,g_id)) {
00126 data->addValue(GOVERNOR_PMIN, data_struct.pmin, g_id);
00127 } else {
00128 data->setValue(GOVERNOR_PMIN, data_struct.pmin, g_id);
00129 }
00130
00131
00132 if (!data->getValue(GOVERNOR_T4,&rval,g_id)) {
00133 data->addValue(GOVERNOR_T4, data_struct.gv_t4, g_id);
00134 } else {
00135 data->setValue(GOVERNOR_T4, data_struct.gv_t4, g_id);
00136 }
00137
00138
00139 if (!data->getValue(GOVERNOR_K1,&rval,g_id)) {
00140 data->addValue(GOVERNOR_K1, data_struct.gv_k1, g_id);
00141 } else {
00142 data->setValue(GOVERNOR_K1, data_struct.gv_k1, g_id);
00143 }
00144
00145
00146 if (!data->getValue(GOVERNOR_K2,&rval,g_id)) {
00147 data->addValue(GOVERNOR_K2, data_struct.gv_k2, g_id);
00148 } else {
00149 data->setValue(GOVERNOR_K2, data_struct.gv_k2, g_id);
00150 }
00151
00152
00153 if (!data->getValue(GOVERNOR_T5,&rval,g_id)) {
00154 data->addValue(GOVERNOR_T5, data_struct.gv_t5, g_id);
00155 } else {
00156 data->setValue(GOVERNOR_T5, data_struct.gv_t5, g_id);
00157 }
00158
00159
00160 if (!data->getValue(GOVERNOR_K3,&rval,g_id)) {
00161 data->addValue(GOVERNOR_K3, data_struct.gv_k3, g_id);
00162 } else {
00163 data->setValue(GOVERNOR_K3, data_struct.gv_k3, g_id);
00164 }
00165
00166
00167 if (!data->getValue(GOVERNOR_K4,&rval,g_id)) {
00168 data->addValue(GOVERNOR_K4, data_struct.gv_k4, g_id);
00169 } else {
00170 data->setValue(GOVERNOR_K4, data_struct.gv_k4, g_id);
00171 }
00172
00173
00174 if (!data->getValue(GOVERNOR_T6,&rval,g_id)) {
00175 data->addValue(GOVERNOR_T6, data_struct.gv_t6, g_id);
00176 } else {
00177 data->setValue(GOVERNOR_T6, data_struct.gv_t6, g_id);
00178 }
00179
00180
00181 if (!data->getValue(GOVERNOR_K5,&rval,g_id)) {
00182 data->addValue(GOVERNOR_K5, data_struct.gv_k5, g_id);
00183 } else {
00184 data->setValue(GOVERNOR_K5, data_struct.gv_k5, g_id);
00185 }
00186
00187
00188 if (!data->getValue(GOVERNOR_K6,&rval,g_id)) {
00189 data->addValue(GOVERNOR_K6, data_struct.gv_k6, g_id);
00190 } else {
00191 data->setValue(GOVERNOR_K6, data_struct.gv_k6, g_id);
00192 }
00193
00194
00195 if (!data->getValue(GOVERNOR_T7,&rval,g_id)) {
00196 data->addValue(GOVERNOR_T7, data_struct.gv_t7, g_id);
00197 } else {
00198 data->setValue(GOVERNOR_T7, data_struct.gv_t7, g_id);
00199 }
00200
00201
00202 if (!data->getValue(GOVERNOR_K7,&rval,g_id)) {
00203 data->addValue(GOVERNOR_K7, data_struct.gv_k7, g_id);
00204 } else {
00205 data->setValue(GOVERNOR_K7, data_struct.gv_k7, g_id);
00206 }
00207
00208
00209 if (!data->getValue(GOVERNOR_K8,&rval,g_id)) {
00210 data->addValue(GOVERNOR_K8, data_struct.gv_k8, g_id);
00211 } else {
00212 data->setValue(GOVERNOR_K8, data_struct.gv_k8, g_id);
00213 }
00214
00215
00216 if (!data->getValue(GOVERNOR_DB1,&rval,g_id)) {
00217 data->addValue(GOVERNOR_DB1, data_struct.db1, g_id);
00218 } else {
00219 data->setValue(GOVERNOR_DB1, data_struct.db1, g_id);
00220 }
00221
00222
00223 if (!data->getValue(GOVERNOR_ERR,&rval,g_id)) {
00224 data->addValue(GOVERNOR_ERR, data_struct.err, g_id);
00225 } else {
00226 data->setValue(GOVERNOR_ERR, data_struct.err, g_id);
00227 }
00228
00229
00230 if (!data->getValue(GOVERNOR_DB2,&rval,g_id)) {
00231 data->addValue(GOVERNOR_DB2, data_struct.db2, g_id);
00232 } else {
00233 data->setValue(GOVERNOR_DB2, data_struct.db2, g_id);
00234 }
00235
00236
00237 if (!data->getValue(GOVERNOR_GV1,&rval,g_id)) {
00238 data->addValue(GOVERNOR_GV1, data_struct.gv1, g_id);
00239 } else {
00240 data->setValue(GOVERNOR_GV1, data_struct.gv1, g_id);
00241 }
00242
00243
00244 if (!data->getValue(GOVERNOR_PGV1,&rval,g_id)) {
00245 data->addValue(GOVERNOR_PGV1, data_struct.pgv1, g_id);
00246 } else {
00247 data->setValue(GOVERNOR_PGV1, data_struct.pgv1, g_id);
00248 }
00249
00250
00251 if (!data->getValue(GOVERNOR_GV2,&rval,g_id)) {
00252 data->addValue(GOVERNOR_GV2, data_struct.gv2, g_id);
00253 } else {
00254 data->setValue(GOVERNOR_GV2, data_struct.gv2, g_id);
00255 }
00256
00257
00258 if (!data->getValue(GOVERNOR_PGV2,&rval,g_id)) {
00259 data->addValue(GOVERNOR_PGV2, data_struct.pgv2, g_id);
00260 } else {
00261 data->setValue(GOVERNOR_PGV2, data_struct.pgv2, g_id);
00262 }
00263
00264
00265 if (!data->getValue(GOVERNOR_GV3,&rval,g_id)) {
00266 data->addValue(GOVERNOR_GV3, data_struct.gv3, g_id);
00267 } else {
00268 data->setValue(GOVERNOR_GV3, data_struct.gv3, g_id);
00269 }
00270
00271
00272 if (!data->getValue(GOVERNOR_PGV3,&rval,g_id)) {
00273 data->addValue(GOVERNOR_PGV3, data_struct.pgv3, g_id);
00274 } else {
00275 data->setValue(GOVERNOR_PGV3, data_struct.pgv3, g_id);
00276 }
00277
00278
00279 if (!data->getValue(GOVERNOR_GV4,&rval,g_id)) {
00280 data->addValue(GOVERNOR_GV4, data_struct.gv4, g_id);
00281 } else {
00282 data->setValue(GOVERNOR_GV4, data_struct.gv4, g_id);
00283 }
00284
00285
00286 if (!data->getValue(GOVERNOR_PGV4,&rval,g_id)) {
00287 data->addValue(GOVERNOR_PGV4, data_struct.pgv4, g_id);
00288 } else {
00289 data->setValue(GOVERNOR_PGV4, data_struct.pgv4, g_id);
00290 }
00291
00292
00293 if (!data->getValue(GOVERNOR_GV5,&rval,g_id)) {
00294 data->addValue(GOVERNOR_GV5, data_struct.gv5, g_id);
00295 } else {
00296 data->setValue(GOVERNOR_GV5, data_struct.gv5, g_id);
00297 }
00298
00299
00300 if (!data->getValue(GOVERNOR_PGV5,&rval,g_id)) {
00301 data->addValue(GOVERNOR_PGV5, data_struct.pgv5, g_id);
00302 } else {
00303 data->setValue(GOVERNOR_PGV5, data_struct.pgv5, g_id);
00304 }
00305
00306
00307 if (!data->getValue(GOVERNOR_IBLOCK,&ival,g_id)) {
00308 data->addValue(GOVERNOR_IBLOCK, data_struct.iblock, g_id);
00309 } else {
00310 data->setValue(GOVERNOR_IBLOCK, data_struct.iblock, g_id);
00311 }
00312 }
00313
00314
00315
00316
00317
00318
00319
00320 void parse(std::vector<std::string> &split_line,
00321 gridpack::component::DataCollection *data, int g_id)
00322 {
00323 double rval;
00324 int nstr = split_line.size();
00325 bool bval;
00326 int ival;
00327
00328 if (!data->getValue(HAS_GOVERNOR,&bval,g_id)) {
00329 data->addValue(HAS_GOVERNOR, true, g_id);
00330 } else {
00331 data->setValue(HAS_GOVERNOR, true, g_id);
00332 }
00333
00334
00335 std::string stmp, model;
00336 gridpack::utility::StringUtils util;
00337 model = util.trimQuotes(split_line[1]);
00338 util.toUpper(model);
00339 if (!data->getValue(GOVERNOR_MODEL,&stmp,g_id)) {
00340 data->addValue(GOVERNOR_MODEL, model.c_str(), g_id);
00341 } else {
00342 data->setValue(GOVERNOR_MODEL, model.c_str(), g_id);
00343 }
00344
00345
00346 if (nstr > 3) {
00347 if (!data->getValue(GOVERNOR_JBUS,&ival,g_id)) {
00348 data->addValue(GOVERNOR_JBUS,
00349 atoi(split_line[3].c_str()), g_id);
00350 } else {
00351 data->setValue(GOVERNOR_JBUS,
00352 atoi(split_line[3].c_str()), g_id);
00353 }
00354 }
00355
00356
00357 if (nstr > 4) {
00358 if (!data->getValue(GOVERNOR_M,&ival,g_id)) {
00359 data->addValue(GOVERNOR_M,
00360 atoi(split_line[4].c_str()), g_id);
00361 } else {
00362 data->setValue(GOVERNOR_M,
00363 atoi(split_line[4].c_str()), g_id);
00364 }
00365 }
00366
00367
00368 if (nstr > 5) {
00369 if (!data->getValue(GOVERNOR_K,&rval,g_id)) {
00370 data->addValue(GOVERNOR_K,
00371 atof(split_line[5].c_str()), g_id);
00372 } else {
00373 data->setValue(GOVERNOR_K,
00374 atof(split_line[5].c_str()), g_id);
00375 }
00376 }
00377
00378
00379 if (nstr > 6) {
00380 if (!data->getValue(GOVERNOR_T1,&rval,g_id)) {
00381 data->addValue(GOVERNOR_T1,
00382 atof(split_line[6].c_str()), g_id);
00383 } else {
00384 data->setValue(GOVERNOR_T1,
00385 atof(split_line[6].c_str()), g_id);
00386 }
00387 }
00388
00389
00390 if (nstr > 7) {
00391 if (!data->getValue(GOVERNOR_T2,&rval,g_id)) {
00392 data->addValue(GOVERNOR_T2,
00393 atof(split_line[7].c_str()), g_id);
00394 } else {
00395 data->setValue(GOVERNOR_T2,
00396 atof(split_line[7].c_str()), g_id);
00397 }
00398 }
00399
00400
00401 if (nstr > 8) {
00402 if (!data->getValue(GOVERNOR_T3,&rval,g_id)) {
00403 data->addValue(GOVERNOR_T3,
00404 atof(split_line[8].c_str()), g_id);
00405 } else {
00406 data->setValue(GOVERNOR_T3,
00407 atof(split_line[8].c_str()), g_id);
00408 }
00409 }
00410
00411
00412 if (nstr > 9) {
00413 if (!data->getValue(GOVERNOR_UO,&rval,g_id)) {
00414 data->addValue(GOVERNOR_UO,
00415 atof(split_line[9].c_str()), g_id);
00416 } else {
00417 data->setValue(GOVERNOR_UO,
00418 atof(split_line[9].c_str()), g_id);
00419 }
00420 }
00421
00422
00423 if (nstr > 10) {
00424 if (!data->getValue(GOVERNOR_UC,&rval,g_id)) {
00425 data->addValue(GOVERNOR_UC,
00426 atof(split_line[10].c_str()), g_id);
00427 } else {
00428 data->setValue(GOVERNOR_UC,
00429 atof(split_line[10].c_str()), g_id);
00430 }
00431 }
00432
00433
00434 if (nstr > 11) {
00435 if (!data->getValue(GOVERNOR_PMAX,&rval,g_id)) {
00436 data->addValue(GOVERNOR_PMAX,
00437 atof(split_line[11].c_str()), g_id);
00438 } else {
00439 data->setValue(GOVERNOR_PMAX,
00440 atof(split_line[11].c_str()), g_id);
00441 }
00442 }
00443
00444
00445 if (nstr > 12) {
00446 if (!data->getValue(GOVERNOR_PMIN,&rval,g_id)) {
00447 data->addValue(GOVERNOR_PMIN,
00448 atof(split_line[12].c_str()), g_id);
00449 } else {
00450 data->setValue(GOVERNOR_PMIN,
00451 atof(split_line[12].c_str()), g_id);
00452 }
00453 }
00454
00455
00456 if (nstr > 13) {
00457 if (!data->getValue(GOVERNOR_T4,&rval,g_id)) {
00458 data->addValue(GOVERNOR_T4,
00459 atof(split_line[13].c_str()), g_id);
00460 } else {
00461 data->setValue(GOVERNOR_T4,
00462 atof(split_line[13].c_str()), g_id);
00463 }
00464 }
00465
00466
00467 if (nstr > 14) {
00468 if (!data->getValue(GOVERNOR_K1,&rval,g_id)) {
00469 data->addValue(GOVERNOR_K1,
00470 atof(split_line[14].c_str()), g_id);
00471 } else {
00472 data->setValue(GOVERNOR_K1,
00473 atof(split_line[14].c_str()), g_id);
00474 }
00475 }
00476
00477
00478 if (nstr > 15) {
00479 if (!data->getValue(GOVERNOR_K2,&rval,g_id)) {
00480 data->addValue(GOVERNOR_K2,
00481 atof(split_line[15].c_str()), g_id);
00482 } else {
00483 data->setValue(GOVERNOR_K2,
00484 atof(split_line[15].c_str()), g_id);
00485 }
00486 }
00487
00488
00489 if (nstr > 16) {
00490 if (!data->getValue(GOVERNOR_T5,&rval,g_id)) {
00491 data->addValue(GOVERNOR_T5,
00492 atof(split_line[16].c_str()), g_id);
00493 } else {
00494 data->setValue(GOVERNOR_T5,
00495 atof(split_line[16].c_str()), g_id);
00496 }
00497 }
00498
00499
00500 if (nstr > 17) {
00501 if (!data->getValue(GOVERNOR_K3,&rval,g_id)) {
00502 data->addValue(GOVERNOR_K3,
00503 atof(split_line[17].c_str()), g_id);
00504 } else {
00505 data->setValue(GOVERNOR_K3,
00506 atof(split_line[17].c_str()), g_id);
00507 }
00508 }
00509
00510
00511 if (nstr > 18) {
00512 if (!data->getValue(GOVERNOR_K4,&rval,g_id)) {
00513 data->addValue(GOVERNOR_K4,
00514 atof(split_line[18].c_str()), g_id);
00515 } else {
00516 data->setValue(GOVERNOR_K4,
00517 atof(split_line[18].c_str()), g_id);
00518 }
00519 }
00520
00521
00522 if (nstr > 19) {
00523 if (!data->getValue(GOVERNOR_T6,&rval,g_id)) {
00524 data->addValue(GOVERNOR_T6,
00525 atof(split_line[19].c_str()), g_id);
00526 } else {
00527 data->setValue(GOVERNOR_T6,
00528 atof(split_line[19].c_str()), g_id);
00529 }
00530 }
00531
00532
00533 if (nstr > 20) {
00534 if (!data->getValue(GOVERNOR_K5,&rval,g_id)) {
00535 data->addValue(GOVERNOR_K5,
00536 atof(split_line[20].c_str()), g_id);
00537 } else {
00538 data->setValue(GOVERNOR_K5,
00539 atof(split_line[20].c_str()), g_id);
00540 }
00541 }
00542
00543
00544 if (nstr > 21) {
00545 if (!data->getValue(GOVERNOR_K6,&rval,g_id)) {
00546 data->addValue(GOVERNOR_K6,
00547 atof(split_line[21].c_str()), g_id);
00548 } else {
00549 data->setValue(GOVERNOR_K6,
00550 atof(split_line[21].c_str()), g_id);
00551 }
00552 }
00553
00554
00555 if (nstr > 22) {
00556 if (!data->getValue(GOVERNOR_T7,&rval,g_id)) {
00557 data->addValue(GOVERNOR_T7,
00558 atof(split_line[22].c_str()), g_id);
00559 } else {
00560 data->setValue(GOVERNOR_T7,
00561 atof(split_line[22].c_str()), g_id);
00562 }
00563 }
00564
00565
00566 if (nstr > 23) {
00567 if (!data->getValue(GOVERNOR_K7,&rval,g_id)) {
00568 data->addValue(GOVERNOR_K7,
00569 atof(split_line[23].c_str()), g_id);
00570 } else {
00571 data->setValue(GOVERNOR_K7,
00572 atof(split_line[23].c_str()), g_id);
00573 }
00574 }
00575
00576
00577 if (nstr > 24) {
00578 if (!data->getValue(GOVERNOR_K8,&rval,g_id)) {
00579 data->addValue(GOVERNOR_K8,
00580 atof(split_line[24].c_str()), g_id);
00581 } else {
00582 data->setValue(GOVERNOR_K8,
00583 atof(split_line[24].c_str()), g_id);
00584 }
00585 }
00586
00587
00588 if (nstr > 25) {
00589 if (!data->getValue(GOVERNOR_DB1,&rval,g_id)) {
00590 data->addValue(GOVERNOR_DB1,
00591 atof(split_line[25].c_str()), g_id);
00592 } else {
00593 data->setValue(GOVERNOR_DB1,
00594 atof(split_line[25].c_str()), g_id);
00595 }
00596 }
00597
00598
00599 if (nstr > 26) {
00600 if (!data->getValue(GOVERNOR_ERR,&rval,g_id)) {
00601 data->addValue(GOVERNOR_ERR,
00602 atof(split_line[26].c_str()), g_id);
00603 } else {
00604 data->setValue(GOVERNOR_ERR,
00605 atof(split_line[26].c_str()), g_id);
00606 }
00607 }
00608
00609
00610 if (nstr > 27) {
00611 if (!data->getValue(GOVERNOR_DB2,&rval,g_id)) {
00612 data->addValue(GOVERNOR_DB2,
00613 atof(split_line[27].c_str()), g_id);
00614 } else {
00615 data->setValue(GOVERNOR_DB2,
00616 atof(split_line[27].c_str()), g_id);
00617 }
00618 }
00619
00620
00621 if (nstr > 28) {
00622 if (!data->getValue(GOVERNOR_GV1,&rval,g_id)) {
00623 data->addValue(GOVERNOR_GV1,
00624 atof(split_line[28].c_str()), g_id);
00625 } else {
00626 data->setValue(GOVERNOR_GV1,
00627 atof(split_line[28].c_str()), g_id);
00628 }
00629 }
00630
00631
00632 if (nstr > 29) {
00633 if (!data->getValue(GOVERNOR_PGV1,&rval,g_id)) {
00634 data->addValue(GOVERNOR_PGV1,
00635 atof(split_line[29].c_str()), g_id);
00636 } else {
00637 data->setValue(GOVERNOR_PGV1,
00638 atof(split_line[29].c_str()), g_id);
00639 }
00640 }
00641
00642
00643 if (nstr > 30) {
00644 if (!data->getValue(GOVERNOR_GV2,&rval,g_id)) {
00645 data->addValue(GOVERNOR_GV2,
00646 atof(split_line[30].c_str()), g_id);
00647 } else {
00648 data->setValue(GOVERNOR_GV2,
00649 atof(split_line[30].c_str()), g_id);
00650 }
00651 }
00652
00653
00654 if (nstr > 31) {
00655 if (!data->getValue(GOVERNOR_PGV2,&rval,g_id)) {
00656 data->addValue(GOVERNOR_PGV2,
00657 atof(split_line[31].c_str()), g_id);
00658 } else {
00659 data->setValue(GOVERNOR_PGV2,
00660 atof(split_line[31].c_str()), g_id);
00661 }
00662 }
00663
00664
00665 if (nstr > 32) {
00666 if (!data->getValue(GOVERNOR_GV3,&rval,g_id)) {
00667 data->addValue(GOVERNOR_GV3,
00668 atof(split_line[32].c_str()), g_id);
00669 } else {
00670 data->setValue(GOVERNOR_GV3,
00671 atof(split_line[32].c_str()), g_id);
00672 }
00673 }
00674
00675
00676 if (nstr > 33) {
00677 if (!data->getValue(GOVERNOR_PGV3,&rval,g_id)) {
00678 data->addValue(GOVERNOR_PGV3,
00679 atof(split_line[33].c_str()), g_id);
00680 } else {
00681 data->setValue(GOVERNOR_PGV3,
00682 atof(split_line[33].c_str()), g_id);
00683 }
00684 }
00685
00686
00687 if (nstr > 34) {
00688 if (!data->getValue(GOVERNOR_GV4,&rval,g_id)) {
00689 data->addValue(GOVERNOR_GV4,
00690 atof(split_line[34].c_str()), g_id);
00691 } else {
00692 data->setValue(GOVERNOR_GV4,
00693 atof(split_line[34].c_str()), g_id);
00694 }
00695 }
00696
00697
00698 if (nstr > 35) {
00699 if (!data->getValue(GOVERNOR_PGV4,&rval,g_id)) {
00700 data->addValue(GOVERNOR_PGV4,
00701 atof(split_line[35].c_str()), g_id);
00702 } else {
00703 data->setValue(GOVERNOR_PGV4,
00704 atof(split_line[35].c_str()), g_id);
00705 }
00706 }
00707
00708
00709 if (nstr > 36) {
00710 if (!data->getValue(GOVERNOR_GV5,&rval,g_id)) {
00711 data->addValue(GOVERNOR_GV5,
00712 atof(split_line[36].c_str()), g_id);
00713 } else {
00714 data->setValue(GOVERNOR_GV4,
00715 atof(split_line[36].c_str()), g_id);
00716 }
00717 }
00718
00719
00720 if (nstr > 37) {
00721 if (!data->getValue(GOVERNOR_PGV5,&rval,g_id)) {
00722 data->addValue(GOVERNOR_PGV5,
00723 atof(split_line[37].c_str()), g_id);
00724 } else {
00725 data->setValue(GOVERNOR_PGV5,
00726 atof(split_line[37].c_str()), g_id);
00727 }
00728 }
00729
00730
00731 if (nstr > 38) {
00732 if (!data->getValue(GOVERNOR_IBLOCK,&ival,g_id)) {
00733 data->addValue(GOVERNOR_PGV5,
00734 atoi(split_line[38].c_str()), g_id);
00735 } else {
00736 data->setValue(GOVERNOR_IBLOCK,
00737 atoi(split_line[38].c_str()), g_id);
00738 }
00739 }
00740 }
00741
00742
00743
00744
00745
00746
00747 void store(std::vector<std::string> &split_line,_data_struct &data)
00748 {
00749
00750 int o_idx;
00751 o_idx = atoi(split_line[0].c_str());
00752 data.bus_id = o_idx;
00753
00754
00755 gridpack::utility::StringUtils util;
00756 std::string tag = util.clean2Char(split_line[2]);
00757 strcpy(data.gen_id, tag.c_str());
00758
00759 std::string sval;
00760
00761 sval = util.trimQuotes(split_line[1]);
00762 util.toUpper(sval);
00763
00764
00765 strcpy(data.model, sval.c_str());
00766
00767 int nstr = split_line.size();
00768
00769 if (nstr > 3) {
00770 data.jbus = atoi(split_line[3].c_str());
00771 }
00772
00773
00774 if (nstr > 4) {
00775 data.gv_m = atoi(split_line[4].c_str());
00776 }
00777
00778
00779 if (nstr > 5) {
00780 data.gv_k = atof(split_line[5].c_str());
00781 }
00782
00783
00784 if (nstr > 6) {
00785 data.gv_t1 = atof(split_line[6].c_str());
00786 }
00787
00788
00789 if (nstr > 7) {
00790 data.gv_t2 = atof(split_line[7].c_str());
00791 }
00792
00793
00794 if (nstr > 8) {
00795 data.gv_t3 = atof(split_line[8].c_str());
00796 }
00797
00798
00799 if (nstr > 9) {
00800 data.gv_uo = atof(split_line[9].c_str());
00801 }
00802
00803
00804 if (nstr > 10) {
00805 data.gv_uc = atof(split_line[10].c_str());
00806 }
00807
00808
00809 if (nstr > 11) {
00810 data.pmax = atof(split_line[11].c_str());
00811 }
00812
00813
00814 if (nstr > 12) {
00815 data.pmin = atof(split_line[12].c_str());
00816 }
00817
00818
00819 if (nstr > 13) {
00820 data.gv_t4 = atof(split_line[13].c_str());
00821 }
00822
00823
00824 if (nstr > 14) {
00825 data.gv_k1 = atof(split_line[14].c_str());
00826 }
00827
00828
00829 if (nstr > 15) {
00830 data.gv_k2 = atof(split_line[15].c_str());
00831 }
00832
00833
00834 if (nstr > 16) {
00835 data.gv_t5 = atof(split_line[16].c_str());
00836 }
00837
00838
00839 if (nstr > 17) {
00840 data.gv_k3 = atof(split_line[17].c_str());
00841 }
00842
00843
00844 if (nstr > 18) {
00845 data.gv_k4 = atof(split_line[18].c_str());
00846 }
00847
00848
00849 if (nstr > 19) {
00850 data.gv_t6 = atof(split_line[19].c_str());
00851 }
00852
00853
00854 if (nstr > 20) {
00855 data.gv_k5 = atof(split_line[20].c_str());
00856 }
00857
00858
00859 if (nstr > 21) {
00860 data.gv_k6 = atof(split_line[21].c_str());
00861 }
00862
00863
00864 if (nstr > 22) {
00865 data.gv_t7 = atof(split_line[22].c_str());
00866 }
00867
00868
00869 if (nstr > 23) {
00870 data.gv_k7 = atof(split_line[23].c_str());
00871 }
00872
00873
00874 if (nstr > 24) {
00875 data.gv_k8 = atof(split_line[24].c_str());
00876 }
00877
00878
00879 if (nstr > 25) {
00880 data.db1 = atof(split_line[25].c_str());
00881 }
00882
00883
00884 if (nstr > 26) {
00885 data.err = atof(split_line[26].c_str());
00886 }
00887
00888
00889 if (nstr > 27) {
00890 data.db2 = atof(split_line[27].c_str());
00891 }
00892
00893
00894 if (nstr > 28) {
00895 data.gv1 = atof(split_line[28].c_str());
00896 }
00897
00898
00899 if (nstr > 29) {
00900 data.pgv1 = atof(split_line[29].c_str());
00901 }
00902
00903
00904 if (nstr > 30) {
00905 data.gv2 = atof(split_line[30].c_str());
00906 }
00907
00908
00909 if (nstr > 31) {
00910 data.pgv2 = atof(split_line[31].c_str());
00911 }
00912
00913
00914 if (nstr > 32) {
00915 data.gv3 = atof(split_line[32].c_str());
00916 }
00917
00918
00919 if (nstr > 33) {
00920 data.pgv3 = atof(split_line[33].c_str());
00921 }
00922
00923
00924 if (nstr > 34) {
00925 data.gv4 = atof(split_line[34].c_str());
00926 }
00927
00928
00929 if (nstr > 35) {
00930 data.pgv4 = atof(split_line[35].c_str());
00931 }
00932
00933
00934 if (nstr > 36) {
00935 data.gv5 = atof(split_line[36].c_str());
00936 }
00937
00938
00939 if (nstr > 37) {
00940 data.pgv5 = atof(split_line[37].c_str());
00941 }
00942
00943
00944 if (nstr > 38) {
00945 data.iblock = atoi(split_line[38].c_str());
00946 }
00947 }
00948 };
00949 }
00950 }
00951 #endif